package com.gaogzhen.algorithm.leetCode;

import java.util.HashMap;
import java.util.Map;

public class ParkingSystem {
    Map<Integer, Integer> map = new HashMap<>(3);

    public ParkingSystem(int big, int medium, int small) {
      map.put(big, big);
      map.put(medium, medium);
      map.put(small, small);
    }

    public boolean addCar(int carType) {
       if ( !map.containsKey(carType) || map.get(carType) == 0) return false;
       map.put(carType, map.get(carType) - 1);
       return true;
    }
}
